  var table = layui.table;
  var form = layui.form;
  var laydate = layui.laydate;

$("#operStatusSelect").initSelectDict();
$("#operTypeSelect").initSelectDict();


laydate.render({
    elem: '#operTimeStart'
    ,type: 'datetime'
});

laydate.render({
	elem: '#operTimeEnd'
	,type: 'datetime'
});
  
  initTable({
	 elem: '#operLog-t'
    ,url: ctx+'/sys/operLog/getPage'
    ,toolbar: '#operLog-t-toolbar'
    ,cols: [[
       {field:'id',  title: 'ID', hide: true}
      ,{field:'operUserCode', minWidth:100, title: '用户编码', sort: true}
      ,{field:'operIp', minWidth:150, title: 'IP', sort: true}
      ,{field:'operModul', minWidth:150, title: '操作模块', sort: true}
      ,{field:'operType', minWidth:150, title: '操作类型',  sort: true}
      ,{field:'operUri', minWidth:150, title: 'uri', sort: true}
      ,{field:'operMethod', minWidth:150, title: '方法', sort: true}
      ,{field:'operReqParam', minWidth:150, title: '请求参数'}
      ,{field:'operResParam', minWidth:150, title: '返回参数'}
      ,{field:'operTime', minWidth:150, title: '操作时间',  sort: true}
      ,{field:'operStatus', minWidth:80, title: '返回状态',  sort: true}
      ,{
			title: '操作',
			align: 'center',
			toolbar: '#operLog-t-tool',
			fixed: 'right',
			minWidth: 80,
		}
    ]]
  })
  
  //条件搜索
  $("#operLogSearch").click(function(){
	    var searchData = $("#operLogSearchForm").serializeObject();
		layui.table.reload('operLog-t', {
			where : searchData,
			page : {
				curr : 1
			}
		});
  })
  
  //监听工具条
  table.on('tool(operLog-t)', function(obj){
    var id = obj.data.id;
    if(obj.event === 'detail'){
    	var url = ctx+"/sys/operLog/detail?id="+id;
		$.get(url, {}, function(res){
			if(!isJSON(res)){
			  var index = layer.open({
					type: 1,
					title: '详情',
					skin: 'layui-layer-rim', 
					area: ['60%', '75%'],
					offset: ['0%', '10%'],
			        content: res,
					btn: [],
					end: function(){
						tableReload();
					}
			        ,maxmin: true
			  });
			  layer.full(index);
			}
		  });
    } 
  });
  
  
  
